home *** CD-ROM | disk | FTP | other *** search
- PROCEDURE Supremo;
-
- { This robot takes his tracking and
- shooting style from the C-Robot by
- Hortense Endoh, and combines it with
- the Runner type technique from T.Harnish.
- The difference is that he stays farther
- away from walls (like the inside corners
- of a picture frame) and also crosses the
- field diagonally. One on one, he's tough.
-
- Rick Bross }
-
- VAR
- Deg,Dir,Spd : Integer;
- PROCEDURE Shoot(Dir,Spd : Integer); {Track and shoot}
- VAR
- Range : Integer;
- BEGIN
- Drive(Dir,Spd);
- Range := Scan(Deg,10);
- IF Range > 39 THEN
- Cannon(Deg,Range)
- ELSE
- BEGIN
- Deg := Deg + 20;
- IF Scan(Deg,10) = 0 THEN
- BEGIN
- Deg := Deg - 40;
- IF Scan(Deg,10) = 0 THEN
- BEGIN
- Deg := Deg + 60;
- IF Scan(Deg,10) = 0 THEN
- Deg := Deg - 80;
- WHILE Scan(Deg,10) = 0 DO
- Deg := Deg + 20;
- END;
- END;
- Cannon(Deg,Scan(Deg,10));
- END;
- END;
-
- BEGIN
- Dir := Angle_To(0,999);
- WHILE (Loc_X > 230) AND (Loc_Y < 770) DO {Travel to upper left}
- Shoot(Dir,100); {Shoot the whole way, of course!}
- Drive(Dir,0); {Need this to slow down in time.}
- WHILE (Speed > 50) DO {Slow down}
- Shoot(Dir,0); {Still shooting}
-
- REPEAT {Go down left side}
- WHILE (Loc_Y > 230) DO
- Shoot(270,100);
- Drive(270,0); {Need this to slow down in time}
- WHILE (Speed > 50) DO {Slow down}
- Shoot(270,0);
-
- {Go across bottom}
- WHILE (Loc_X < 770) DO
- Shoot(0,100);
- Drive(0,0);
- WHILE (Speed > 50) DO
- Shoot(0,0);
-
- {Go up right side}
- WHILE (Loc_Y < 770) DO
- Shoot(90,100);
- Drive(90,0);
- WHILE (Speed > 50) DO
- Shoot(90,0);
-
- {Go from upper right to lower left}
- WHILE (Loc_Y > 230) DO
- Shoot(225,100);
- Drive(225,0);
- WHILE (Speed > 50) DO
- Shoot(225,0);
-
- {Go up left side}
- WHILE (Loc_Y < 770) DO
- Shoot(90,100);
- Drive(90,0);
- WHILE (Speed > 50) DO
- Shoot(90,0);
-
- {Go from upper left to lower right}
- WHILE (Loc_X < 770) DO
- Shoot(315,100);
- Drive(315,0);
- WHILE (Speed > 50) DO
- Shoot(315,0);
-
- {Go up right side}
- WHILE (Loc_Y < 770) DO
- Shoot(90,100);
- Drive(90,0);
- WHILE (Speed > 50) DO
- Shoot(90,0);
-
- {Go across top}
- WHILE (Loc_X > 230) DO
- Shoot(180,100);
- Drive(180,0);
- WHILE (Speed > 50) DO
- Shoot(180,0);
-
- UNTIL Dead OR Winner;
-
- END; { End Supremo Main }
-